package com.morphiastic.fieldbridge;

import java.io.IOException;
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.IdentityHashMap;

import org.elasticsearch.common.xcontent.XContentBuilder;

import com.morphiastic.ElasticStore;
import com.morphiastic.IndexedFieldBridge;

public class VoidIndexedFieldBridge extends IndexedFieldBridge {

	@Override
	public XContentBuilder writeIndexedField(XContentBuilder mappingBuilder,
			String fieldName, Object o, ElasticStore es,
			Integer maxCircularRefDepth, IdentityHashMap<AccessibleObject, Integer> known)
			throws IOException {
		throw new IllegalArgumentException(" VoidIndexedFieldBridge should never be used as a real field bridge .... It is just used as a placeholder in the ElastiFieldBridge Annotation. there is something wrong in your mappings. the object we are trying to index is  : " + o);
	}

	@Override
	public void addIndexFieldSettings(XContentBuilder mappingBuilder)
			throws IOException {
		throw new IllegalArgumentException(" VoidIndexedFieldBridge should never be used as a real field bridge .... It is just used as a placeholder in the ElastiFieldBridge Annotation. there is something wrong in your mappings.");

		
	}

	@Override
	public void addFieldSettingsMap(HashMap<String, Object> props) {
		throw new IllegalArgumentException(" VoidIndexedFieldBridge should never be used as a real field bridge .... It is just used as a placeholder in the ElastiFieldBridge Annotation. there is something wrong in your mappings.");

		
	}

	@Override
	public void init(ElasticStore es, HashMap<?, ?> params) {
	}

	 

}
